package com.wqm.step.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wqm.step.pojo.Customer;
import com.wqm.step.pojo.Order;
import com.wqm.step.service.HibernateService;

@Controller
public class LoadContrller {

	@Autowired
	private HibernateService hibernateService;
	
	/**
	 *  演示延迟加载， 并去除web.xml中的延迟加载配置，看看会不会报错
	 *  get 与 load的区别： load延迟加载(用于性能优化)
	 */
	@RequestMapping(value = "findLoad.action", produces = { "text/html;charset=UTF-8" })
	@ResponseBody
	public String findLoad() {
		Customer list = hibernateService.findLoad();
		/*String string = FastJsonUtils.toJSONString(list);*/
		return list.toString();
	}
}
